package com.intelligentclass.entity;

import jakarta.persistence.*;

import java.util.List;

@Entity
public class Teaching {

    @Id
    private int cid;

    private String cno;
    private String tno;

    private String introduce;

    @ManyToMany(mappedBy = "courseList")
    private List<Student> studentList;

    @OneToMany(mappedBy = "cid", cascade = CascadeType.ALL, fetch = FetchType.LAZY)
    private List<Homework> homeworkList;

    public Teaching(){}

    public Teaching(int cid, String cno, String tno) {
        this.cid = cid;
        this.cno = cno;
        this.tno = tno;
    }

    public int getCid() {
        return cid;
    }
    public void setCid(int cid) {
        this.cid = cid;
    }
    public String getCno() {
        return cno;
    }
    public void setCno(String cno) {
        this.cno = cno;
    }
    public String getTno() {
        return tno;
    }
    public void setTno(String tno) {
        this.tno = tno;
    }
    public List<Student> getStudentList() {
        return studentList;
    }
    public void setStudentList(List<Student> studentList) {
        this.studentList = studentList;
    }
    public List<Homework> getHomeworkList() {
        return homeworkList;
    }
    public void setHomeworkList(List<Homework> homeworkList) {
        this.homeworkList = homeworkList;
    }
    public String getIntroduce() {
        return introduce;
    }
    public void setIntroduce(String introduce) {
        this.introduce = introduce;
    }
}
